<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use BadMethodCallException;
use Request;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    protected $version = 'version 1.0.0';

    /**
     * Bad method call function
     * @param string $name
     * @param array $arguments
     * @return mixed|void
     */
    public function __call($name, $arguments)
    {
        // TODO: Implement __call() method.
        throw new BadMethodCallException("该版本 [".$this->version."] 该方法 $name 不支持");
    }

    /**
     * Get an input element from the request.
     * @param $key
     * @return mixed
     */
    public function getParam($key)
    {
        return Request::__get($key);
    }
}
